package com.wu.family.utils;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.widget.ImageView;


public class LoadImgTask extends AsyncTask<Object, Bitmap, Bitmap>
{
	private ImageView imageView;
	private String url;
	private Context context;
	public LoadImgTask(Context context, ImageView imageView, String url) {
		super();
		this.context = context;
		this.imageView = imageView;
		this.url = url;
	}

	@Override
	protected void onPreExecute() {
		super.onPreExecute();
	}

	@Override
	protected Bitmap doInBackground(Object... arg0)
	{
		 
		return NetHelper.getBitmapByUrlNoCache(context, url);
	}

	@Override
	protected void onPostExecute(Bitmap bitmap)
	{
		if (bitmap != null) {
			imageView.setImageBitmap(bitmap);
			imageView.setTag(url);
		}
	}
}
